<?php if (!$page): ?>
    <article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
    <?php endif; ?>
    <h2 class="title"><?php print $node->title; ?></h2>

    <div class="event_area">

		<div class="info_thumb">

			<?php if (isset($content['field_event_thumbnail']['#items']) && count($content['field_event_thumbnail']['#items'])) : ?>
				<?php foreach ($content['field_event_thumbnail']['#items'] as $i) : ?>
					<div class="thumb"><img src="<?php echo image_style_url('w150', $i['uri']); ?>" /></div>
				<?php endforeach; ?>
			<?php else : ?>
				<div class="thumb"></div>
			<?php endif; ?>

            <?php if (isset($content['field_event_buy_a_ticket']['#items'][0]['value'])

                    && $content['field_event_buy_a_ticket']['#items'][0]['value'] == 1
                    ) : ?>

			<div class="info">
				<table class="short_info">

				   	<tr>

                    <?php if (isset($content['field_event_ticket_id']['#items'][0]['value'])
                                && trim($content['field_event_ticket_id']['#items'][0]['value']) != ""
                    ) : ?>
                        <script>
                            jQuery(document).ready(function() {
                        		jQuery("#ticketstream_butt_1").click(function() {
                                jQuery.fancybox.open([
                                        {
                                            height: 550,
                                            scrolling : 'auto',
                                            title : 'Заказ билета',
                                            type : 'iframe',
                                            href: "http://www.ticketstream.cz/pls/ukraine/dls.dls_by_event_tr?event_id=<?php echo trim($content['field_event_ticket_id']['#items'][0]['value']) ?>&code=INFOPARK&language=3",
                                            wrapCSS: "ticketstream_css_class"
                                        }
                                        ]);
                                });

                                jQuery("#ticketstream_butt_2").click(function() {
                                jQuery.fancybox.open([
                                        {
                                            title : 'Заказ билета',
                                            type : 'iframe',
                                            href: "<?php echo trim($content['field_event_ticket_type2_id']['#items'][0]['value'])?>",
                                            wrapCSS: "ticketstream_css_class"
                                        }
                                        ]);
                                });
                             });
        </script>
				        <td colspan="2">
							<a class="ticketstream_butt" id="ticketstream_butt_1" target="_blank">Заказать Билет</a>
				        </td>

                    <?php endif; ?>

                    <?php if (isset($content['field_event_ticket_type2_id']['#items'][0]['value'])
                                && trim($content['field_event_ticket_type2_id']['#items'][0]['value']) != ""
                    ) : ?>
                        <td colspan="2">
							<a class="ticketstream_butt" id="ticketstream_butt_2" target="_blank" href=>Заказать Билет</a>
				        </td>
                    <?php endif; ?>
				    </tr>

				</table>
			</div>
            <?php endif; ?>

		</div>

<!--        /* fgf*/-->

    <div class="gallery_list_wrapper">
        <?php $gallery_package_array = get_gallery_package_by_node_id($node->nid);?>
        <?php
        foreach ($gallery_package_array as $gallery_package_id) :?>
        <?php $gallerys_list = get_gallery_liste_by_package_id($gallery_package_id->tid);?>
        <?php
         foreach ($gallerys_list as $gallery) :


          $image_list = get_img_list_by_gallery_id($gallery->nid);?>

<script>


            jQuery(function () {

			jQuery("#gallery_<?php echo $gallery->nid;?>").click(function() {
				jQuery.fancybox.open([




                <?php foreach ($image_list as $image) :  ?>

                                {
                                                                        scrolling : 'auto',
                                    tpl: {
                                    wrap     : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><table class="img_comments"><tr><td><div class="fancybox-inner"></div></td><td class="commentsblocktd"><div class="commentsblock"><iframe src="http://www.facebook.com/plugins/comments.php?href=http://infopark.com.ua/sites/default/files/styles/media_gallery_large/public/<?php echo substr($image->uri, 9); ?>" scrolling="no" frameborder="0" style="border:none; width:100%;  height:230px"></iframe></div></td></tr></table></div></div></div>'
                                    },
                                    'href'	: 'http://infopark.com.ua/sites/default/files/styles/media_gallery_large/public/<?php echo substr($image->uri, 9); ?>',
                                    'title'	: '<?php echo $image->media_title_value; ?>',
                                    wrapCSS: "gallery_css_class"
                                },


               <?php  endforeach; ?>

               				], {
					helpers : {
						thumbs : {
							width: 75,
							height: 50
						}
					}
				});
			});

                });
             </script>
         <?php endforeach;

         ?>


        <?php foreach ($gallerys_list as $gallery) :

              echo gallery_view_prev($gallery->nid);

              endforeach;

        endforeach;
        ?>
	    </div>



		<div class="full_content">
        <?php if (isset($content['field_event_images']['#items']) && count($content['field_event_images']['#items'])) : ?>
            <?php foreach ($content['field_event_images']['#items'] as $i) : ?>
                <a class="fancybox" rel="gallery" href="<?php echo image_style_url('large', $i['uri']); ?>" title="<?php echo htmlspecialchars($i['title']) ?>"><img src="<?php echo image_style_url('50_50', $i['uri']); ?>" /></a>
            <?php endforeach; ?>
            <br /><br />
        <?php endif; ?>

        <?php if (isset($content['field_event_description']['#items'][0]['value'])) : ?>
            <?php echo nl2br($content['field_event_description']['#items'][0]['value']); ?>
        <?php endif; ?>

        <?php if (user_access('bypass node access')) : ?>
            <div class="admin-link">
            <?php echo l('Редактировать', 'node/' . $node->nid . '/edit'); ?>
            </div>
        <?php endif; ?>

		<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>

		</div>
    </div>

    <div class="fb-comments" data-href="http://infopark.com.ua<?php echo $_SERVER['REDIRECT_URL']; ?>" data-num-posts="5" data-width="100%"></div>
<?php if (!$page): ?>
    </article>
<?php endif; ?>